﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine.Animation.ColorAnimation;
using Transformable_Engine_v2.Engine.Animation.PositionAnimation;
using Transformable_Engine_v2.Engine.Animation.RotationAnimation;
using Transformable_Engine_v2.Engine.Animation.ScaleAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Helper;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Particle.Explosion
{
    public class BombOutlineSmoke : ImageContainer
    {

        public BombOutlineSmoke(TE_Vector2 targetPosition)
        {
            Sprite = ParticleSheet.GetSprite(ParticleSheet.Explosion.SmokeOutside);
            Color = new Color(Color.White, 150);
            Origin = TE_Rectangle.Alignment.CenterMiddle;
            Scale = new TE_Vector2(1.25f, 1.25f);

            AddAnimations(new PositionAnimation(new QuadraticEasing(BaseTrajectory.Easing.EaseOut), 
                                                targetPosition * Randomizer.Double(0.7, 1.1),
                                                300, 
                                                false, 
                                                0));
            AddAnimations(new RotationUniformLinearAnimation(0, 1));
            AddAnimations(new ScaleUniformLinearAnimation(500, new TE_Vector2(-0.5f, -0.5f)));
            AddAnimations(new ColorAnimation(new LinearEasing(), Color.Transparent, 700, false, 300));
            Die(1000);
        }
    }
}
